home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 09 - 1993 / 09.02 Feb 93 / Screen I⁄O Classes / B Classes / B.c / BUtilities.c < prev   
Encoding:
C/C++ Source or Header  |  1992-07-12  |  1.9 KB  |  90 lines  |  [TEXT/KAHL]

  1. /******************************************************
  2.  * BUtilities.c
  3.  *
  4.  * General utilities for use with THINK C with objects.
  5.  * © copyright 1991, KSS Scientific Consultants
  6.  * © copyright 1989, Symantecs Corporation.  Some parts
  7.  *   of the code used in this section were derived from their
  8.  *   programs.
  9.  *
  10.  *******************************************************/
  11.  
  12. #include <CApplication.h>
  13. #include "BBitMapDoc.h"
  14. #include "BDisplayOutput.h"
  15. #include "BGetTCLInfo.h"
  16. #include "BUtilities.h"
  17. #include <stdio.h>
  18. #include <string.h>
  19.  
  20. #define DLOGinfo        601        // Resource ID for DLOG template
  21.  
  22. extern CApplication    *gApplication;
  23.  
  24. /***********************************************************************
  25.  * GetInfo()
  26.  *
  27.  * Get data input from the user.
  28.  *
  29.  **********************************************************************/
  30.  
  31. void    GetInfo(char *promptPtr, char *returnPtr)
  32. {
  33.     BGetTCLInfo        *theGetInfo;
  34.     
  35.     TRY
  36.     {
  37.         theGetInfo = new BGetTCLInfo;
  38.         theGetInfo->IBGetTCLInfo(DLOGinfo, gApplication);
  39.         theGetInfo->GetInfo(promptPtr, returnPtr);
  40.     }
  41.     CATCH
  42.     {
  43.         theGetInfo->Dispose();
  44.     }
  45.     ENDTRY;
  46.     theGetInfo->Dispose();
  47. }
  48.  
  49. /************************************************************
  50.  * DumpData()
  51.  *
  52.  * Dump the results to an output window.
  53.  *
  54.  ************************************************************/
  55.  
  56. void DumpData(Handle theData)
  57. {
  58.     BDisplayOutput    *theOutput;
  59.     
  60.     theOutput = new BDisplayOutput;
  61.     theOutput->IBDisplayOutput(gApplication, TRUE);
  62.     theOutput->DisplayRun(theData);
  63.     theOutput->Dispose();
  64. }
  65.  
  66. /***************************************************************
  67.  * DumpBitMap()
  68.  *
  69.  * Dump a bitmap to an output window.
  70.  *
  71.  **************************************************************/
  72.  
  73. void DumpBitMap(BitMap *theBitMap)
  74. {
  75.     BBitMapDoc        *theBitMapDoc;
  76.     
  77.     TRY
  78.     {
  79.         theBitMapDoc = new BBitMapDoc;
  80.         theBitMapDoc->IBBitMapDoc(gApplication, TRUE);
  81.         theBitMapDoc->OutputMap(theBitMap);
  82.     }
  83.     CATCH
  84.     {
  85.         theBitMapDoc->Dispose();
  86.     }
  87.     ENDTRY;
  88.     theBitMapDoc->Dispose();
  89. }
  90.